#!/bin/sh
curl -XDELETE 'http://localhost:9200/applog'
curl -XPUT 'http://localhost:9200/applog'
curl -H 'Content-Type: application/json' -XPUT 'http://localhost:9200/applog/_mapping?pretty' -d '{
        "properties" : {
                "@timestamp" : { "type" : "date" },
                "app" : { "type" : "keyword" },
                "date" : { "type" : "date" },
                "host" : { "type" : "keyword" },
                "level" : { "type" : "keyword" },
                "logger" : { "type" : "keyword" },
                "port" : { "type" : "short" },
                "thread" : { "type" : "keyword" },
                "message" : { "type" : "text", "analyzer": "ik_max_word" },
                "exception" : { "type" : "text", "analyzer": "ik_max_word" }
        }
}'
curl -H 'Content-Type: application/json' -XPUT 'http://localhost:9200/applog/_settings' -d '{
        "index" : {  "max_result_window" : 100000000 }
}'